package org.dtrd.modules.organization.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.organization.entity.po.DtrdEntRdOrganization;

/**
 * <p>
 * 机构表
 * </p>
 *
 * @author QR
 * @since 2021-12-14
 */
@Getter
@Setter
@ApiModel(value = "机构表列表信息", description = "机构表")
public class OrganizationListInfo {

    private Integer dataId;

    @ApiModelProperty("机构编码")
    private String organizationCode;

    @ApiModelProperty("机构名称")
    private String organizationName;

    @ApiModelProperty("机构地址")
    private String organizationAddress;

    @ApiModelProperty("机构等级")
    private Integer organizationLevel;

    @ApiModelProperty("机构等级")
    private String organizationLevelText;


    public OrganizationListInfo (DtrdEntRdOrganization po) {
        dataId = po.getDataId();
        organizationCode = po.getOrganizationCode();
        organizationName = po.getOrganizationName();
        organizationAddress = po.getOrganizationAddress();
        organizationLevel = po.getOrganizationLevel();
        if (organizationLevel != null) {
            organizationLevelText = Constant.OrganizationLevelStatus.valueOf(po.getOrganizationLevel()).getName();
        }
    }
}
